#ifndef PYTHONGRAMMAR30TOKENMANAGER_H
#define PYTHONGRAMMAR30TOKENMANAGER_H
#include "CharStream.h"
#include "Token.h"
#include "TokenManager.h"
#include "PythonGrammar30Constants.h"
class PythonGrammar30;

/** Token Manager. */
class PythonGrammar30TokenManager : public TokenManager
{
public:
    //Class<?> getConstantsClass(){
    //    return PythonGrammar30Constants.class;
    //}

    /**
     * @return The current level of the indentation in the current line.
     */
    int getCurrentLineIndentation() {
        return indent;
    }

    /**
     * @return The current level of the indentation.
     */
    int getLastIndentation() {
        return indentation[level];
    }


    void indenting(int ind) {
        indent = ind;
        if (indent == indentation[level])
            SwitchTo(INDENTATION_UNCHANGED);
        else
            SwitchTo(INDENTING);
    }

    /** Debug output. */
    FILE *debugStream;
    /** Set debug output. */
    virtual CharStream* getInputStream() {
        return input_stream;
    }

    void  setDebugStream(FILE *ds);
public:
    virtual int getCurLexState() {
        return curLexState;
    }

    int jjStopStringLiteralDfa_3(int pos, unsigned long long active0);

    int  jjStartNfa_3(int pos, unsigned long long active0);

    int  jjStopAtPos(int pos, int kind);

    int  jjMoveStringLiteralDfa0_3();

    int jjMoveNfa_3(int startState, int curPos);

    int  jjMoveStringLiteralDfa0_14();

    int  jjMoveStringLiteralDfa0_15();

    int jjStopStringLiteralDfa_9(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjStartNfa_9(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa0_9();

    int  jjMoveStringLiteralDfa1_9(unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa2_9(unsigned long long old1, unsigned long long active1, unsigned long long old2, unsigned long long active2);

    int jjMoveNfa_9(int startState, int curPos);

    int jjStopStringLiteralDfa_7(int pos, unsigned long long active0, unsigned long long active1);

    int  jjStartNfa_7(int pos, unsigned long long active0, unsigned long long active1);

    int  jjMoveStringLiteralDfa0_7();

    int  jjMoveStringLiteralDfa1_7(unsigned long long active1);

    int  jjMoveStringLiteralDfa2_7(unsigned long long old1, unsigned long long active1);

    int jjMoveNfa_7(int startState, int curPos);

    int jjStopStringLiteralDfa_12(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjStartNfa_12(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa0_12();

    int  jjMoveStringLiteralDfa1_12(unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa2_12(unsigned long long old1, unsigned long long active1, unsigned long long old2, unsigned long long active2);

    int jjMoveNfa_12(int startState, int curPos);

    int jjStopStringLiteralDfa_10(int pos, unsigned long long active0, unsigned long long active1);

    int  jjStartNfa_10(int pos, unsigned long long active0, unsigned long long active1);

    int  jjMoveStringLiteralDfa0_10();

    int  jjMoveStringLiteralDfa1_10(unsigned long long active1);

    int  jjMoveStringLiteralDfa2_10(unsigned long long old1, unsigned long long active1);

    int jjMoveNfa_10(int startState, int curPos);

    int  jjMoveStringLiteralDfa0_16();

    int jjStopStringLiteralDfa_4(int pos, unsigned long long active0);

    int  jjStartNfa_4(int pos, unsigned long long active0);

    int  jjMoveStringLiteralDfa0_4();

    int jjMoveNfa_4(int startState, int curPos);

    int  jjMoveStringLiteralDfa0_5();

    int  jjMoveStringLiteralDfa1_5(unsigned long long active0);

    int  jjMoveStringLiteralDfa2_5(unsigned long long old0, unsigned long long active0);

    int  jjMoveStringLiteralDfa3_5(unsigned long long old0, unsigned long long active0);

    int  jjMoveStringLiteralDfa4_5(unsigned long long old0, unsigned long long active0);

    int  jjMoveStringLiteralDfa5_5(unsigned long long old0, unsigned long long active0);

    int  jjMoveStringLiteralDfa6_5(unsigned long long old0, unsigned long long active0);

    int  jjMoveStringLiteralDfa7_5(unsigned long long old0, unsigned long long active0);

    int  jjMoveStringLiteralDfa0_17();

    int jjStopStringLiteralDfa_0(int pos, unsigned long long active0, unsigned long long active1);

    int  jjStartNfa_0(int pos, unsigned long long active0, unsigned long long active1);

    int  jjMoveStringLiteralDfa0_0();

    int  jjMoveStringLiteralDfa1_0(unsigned long long active0, unsigned long long active1);

    int  jjMoveStringLiteralDfa2_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);

    int  jjMoveStringLiteralDfa3_0(unsigned long long old0, unsigned long long active0, unsigned long long old1, unsigned long long active1);

    int  jjMoveStringLiteralDfa4_0(unsigned long long old1, unsigned long long active1);

    int  jjMoveStringLiteralDfa5_0(unsigned long long old1, unsigned long long active1);

    int  jjMoveStringLiteralDfa6_0(unsigned long long old1, unsigned long long active1);

    int  jjMoveStringLiteralDfa7_0(unsigned long long old1, unsigned long long active1);

    int jjStartNfaWithStates_0(int pos, int kind, int state);

    int jjMoveNfa_0(int startState, int curPos);

    int jjStopStringLiteralDfa_13(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjStartNfa_13(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa0_13();

    int  jjMoveStringLiteralDfa1_13(unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa2_13(unsigned long long old1, unsigned long long active1, unsigned long long old2, unsigned long long active2);

    int jjMoveNfa_13(int startState, int curPos);

    int jjStopStringLiteralDfa_11(int pos, unsigned long long active0, unsigned long long active1);

    int  jjStartNfa_11(int pos, unsigned long long active0, unsigned long long active1);

    int  jjMoveStringLiteralDfa0_11();

    int  jjMoveStringLiteralDfa1_11(unsigned long long active1);

    int  jjMoveStringLiteralDfa2_11(unsigned long long old1, unsigned long long active1);

    int jjMoveNfa_11(int startState, int curPos);

    int jjStopStringLiteralDfa_8(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjStartNfa_8(int pos, unsigned long long active0, unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa0_8();

    int  jjMoveStringLiteralDfa1_8(unsigned long long active1, unsigned long long active2);

    int  jjMoveStringLiteralDfa2_8(unsigned long long old1, unsigned long long active1, unsigned long long old2, unsigned long long active2);

    int jjMoveNfa_8(int startState, int curPos);

    int  jjMoveStringLiteralDfa0_2();

    int jjMoveNfa_2(int startState, int curPos);

    int  jjMoveStringLiteralDfa0_1();

    int jjMoveNfa_1(int startState, int curPos);

    int jjStopStringLiteralDfa_6(int pos, unsigned long long active0, unsigned long long active1);

    int  jjStartNfa_6(int pos, unsigned long long active0, unsigned long long active1);

    int  jjMoveStringLiteralDfa0_6();

    int  jjMoveStringLiteralDfa1_6(unsigned long long active1);

    int  jjMoveStringLiteralDfa2_6(unsigned long long old1, unsigned long long active1);

    int jjMoveNfa_6(int startState, int curPos);

    bool jjCanMove_0(int hiByte, int i1, int i2, unsigned long long l1, unsigned long long l2);

    TokenPtr jjFillToken();

public:
    int curLexState;
public:
    int jjnewStateCnt;
public:
    int jjround;
public:
    int jjmatchedPos;
public:
    int jjmatchedKind;


    TokenPtr getNextToken();

    void  SkipLexicalActions(const TokenPtr& matchedToken);

    void  MoreLexicalActions();

    void  TokenLexicalActions(const TokenPtr& matchedToken);

    void jjCheckNAdd(int state);

    void jjAddStates(int start, int end);

    void jjCheckNAddTwoStates(int state1, int state2);

    void jjCheckNAddStates(int start, int end);
private:
    PythonGrammar30*parser;
private:
    void ReInitRounds();
public:
    PythonGrammar30TokenManager(CharStream *stream, int lexState = 0, PythonGrammar30 *parserArg = NULL);
public:
    virtual ~PythonGrammar30TokenManager();
    void ReInit(CharStream *stream, int lexState = 0, PythonGrammar30 *parserArg = NULL);
    void SwitchTo(int lexState);
    const QString jjKindsForBitVector(int i, unsigned long long vec);
    const QString jjKindsForStateVector(int lexState, int vec[], int start, int end);
    CharStream  *input_stream;
    int jjrounds[82];
    int jjstateSet[2 * 82];
    QString jjimage;
    QString image;
    int jjimageLen;
    int lengthOfMatch;
    char curChar;
};
#endif
